package org.apache.dolphinscheduler.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 收支明细表
 * </p>
 *
 * @author denggh
 * @since 2023-08-14
 */
@TableName("t_ds_bill")
public class Bill implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 交易编号
     */
    private String billNo;

    /**
     * userId
     */
    private Integer userId;

    /**
     * 收支类型 0 = 支出 1 = 收入
     */
    private Integer billType;

    /**
     * 交易类型 0 = 消费 1 = 平台服务
     */
    private Integer tradeType;

    /**
     * 交易类型 0 = 账户余额 1 = 平台充值
     */
    private Integer tradeChannel;

    /**
     * 交易金额
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private BigDecimal billNumber;

    /**
     * 关联订单编号
     */
    private String orderNo;

    /**
     * 交易时间
     */
    private Date createTime;

    private Date updateTime;

    /**
     * 账户名称
     */
    @TableField(exist = false)
    private String userName;

    /**
     * 余额
     */
    private BigDecimal balance;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getBillType() {
        return billType;
    }

    public void setBillType(Integer billType) {
        this.billType = billType;
    }

    public Integer getTradeType() {
        return tradeType;
    }

    public void setTradeType(Integer tradeType) {
        this.tradeType = tradeType;
    }

    public BigDecimal getBillNumber() {
        return billNumber;
    }

    public void setBillNumber(BigDecimal billNumber) {
        this.billNumber = billNumber;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getBillNo() {
        return billNo;
    }

    public void setBillNo(String billNo) {
        this.billNo = billNo;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public Integer getTradeChannel() {
        return tradeChannel;
    }

    public void setTradeChannel(Integer tradeChannel) {
        this.tradeChannel = tradeChannel;
    }

    @Override
    public String toString() {
        return "Bill{" +
                "id=" + id +
                ", billNo='" + billNo + '\'' +
                ", userId=" + userId +
                ", billType=" + billType +
                ", tradeType=" + tradeType +
                ", billNumber=" + billNumber +
                ", orderNo='" + orderNo + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", userName='" + userName + '\'' +
                '}';
    }
}
